<? include("database.php");
$business_id = 1;
if(isset($_REQUEST['Submit']))
{
	$default_location = $_REQUEST['default_location'];
	$headquarters_location = $_REQUEST['headquarters_location'];
	$location_dropdown = $_REQUEST['location_dropdown'];
	$location_administrators = $_REQUEST['location_administrators'];
	$access_customers = $_REQUEST['access_customers'];
	$lowest_level = $_REQUEST['lowest_level'];
	$same_staff = $_REQUEST['same_staff'];
}

$query = mysql_query("select * from location_setting where business_id='".$business_id."'");
$num = mysql_num_rows($query);
$data = mysql_fetch_array($query);
if($num == 0)
{
	$query = mysql_query("insert into location_setting(business_id, default_location, headquarters_location, location_dropdown, location_administrators, access_customers, lowest_level, same_staff) values('".$business_id."', '".$default_location."', '".$headquarters_location."', '".$location_dropdown."', '".$location_administrators."', '".$access_customers."', '".$lowest_level."', '".$same_staff."')");
}else
{
	mysql_query("update location_setting set default_location = '".$default_location."', headquarters_location = '".$headquarters_location."', location_dropdown = '".$location_dropdown."', location_administrators = '".$location_administrators."', access_customers = '".$access_customers."', lowest_level = '".$lowest_level."', same_staff = '".$same_staff."' where business_id = '".$business_id."'");
}
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html dir="LTR" lang="en">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<title>Online Appointment</title>

<base >
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<title>Staff Management</title>

</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">


<table cellpadding="0" cellspacing="0" border="0"><tr>
  <td style="background:url(images/top.gif) repeat-x top; ">
<table cellpadding="0" cellspacing="0" border="0" style="width:764px" align="center"> 
	<tr>
		<td>
			<table cellpadding="0" cellspacing="0" border="0" style="height:57">
				<tr>
					<td height="57">
<? html_header(); ?>					</td>
				</tr>
			</table>


		</td>
	</tr>
	<tr>
		<td>





<table border="0" width="105%" cellspacing="0" cellpadding="0">
  <tr>
    <td valign="top" class="col_left">

<table border="0"cellspacing="0" cellpadding="0" class="box_width_left">
	<tr><td width="100%">
		<table border="0" cellspacing="0" cellpadding="0">
<tr><td>

<table border="0" width="100%" cellspacing="0" cellpadding="0" class="">
  <tr>
    <td>
    <table border="0" width="100%" cellspacing="0" cellpadding="0"  class="" height="91">
  <tr>
    <td align="center" height="91">
    <img border="0" src="images/logo.jpg" width="208" height="86"></td>
  </tr>
</table>
</td>
  </tr>
</table>
</td></tr>


          <tr>
            <td>
<table border="0" width="100%" cellspacing="0" cellpadding="0"  class="box_header_txt" height="48">
  <tr>
    <td style="background-image: url(images/1_bg2-2.gif)" height="1">
      <p style="margin-top: 16"> </td>
  </tr>
</table>
<table border="0" width="100%" cellspacing="0" cellpadding="0"   style="border-bottom:12px solid #ffffff;">
  <tr>
    <td>
    <table border="0" width="100%" cellspacing="0" cellpadding="0"  style="margin-bottom:0px;background:#7C7C7C url(images/1_line.gif) no-repeat left bottom;" >
  <tr>
    <td  style="padding:3px 16px 8px 25px;">
      <? include("link.php");?>
    </td>
  </tr>
</table>
</td>
  </tr>
</table>
            </td>
          </tr>


          <tr>
            <td class="">&nbsp;
</td>
          </tr>

		</table>
	</td>
	<td><img src="images/spacer.gif" border="0" alt="" width="15" height="1"></td></tr>
</table>

    </td>

    <td width="100%" valign="top">
<table border="0" width="100%" cellspacing="0" cellpadding="0"  class="cont_header_txt">
  <tr>
    <td>
			<table border="0" cellpadding="0" cellspacing="0" bgcolor="#EAEAEA" class="cont_header_txt">
				<tr>
					<td><img src="images/1_q1.gif" border="0" alt="" width="45" height="39"></td>
					<td style="width:100%">location setting </td>
					<td><img src="images/1_q2.gif" border="0" alt="" width="10" height="39"></td>
				</tr>
			</table>										 
			</td>
  </tr>
</table>


						
						<table cellpadding="0" cellspacing="0" border="0" style="border:0px solid #DEDEDE; border-width:0px 1px 0px 1px;">
                          <tr>
                            <td style="background:#ffffff;border:0px solid #ffffff; border-width:18px 5px 10px 5px;"><!-- new_products //-->
                                <table border="0" width="" cellspacing="0" cellpadding="0">
                                  <tr>
                                    <td>
									<form name="frm" action="" method="post">
									<table width="200" border="1" cellspacing="5" bordercolor="#FFDBCA" class="table">
                                      <tr>
                                        <td width="366" valign="middle" class="simpletxt"><div align="justify"><strong>1. </strong>On the front end, allow customers to select a  location. If this is set to &quot;no&quot;, they will not be able to select a  location and will only be able to make appointments for their default location.</div></td>
                                        <td width="64" align="center" valign="middle">
                                          <input name="default_location" type="radio" value="1"
										 <? if($data['default_location'] == 1) 
											{?> Checked
											<? }?>>
                                          <span class="simpletxt">Yes</span>
                                      </td>
                                        <td width="50" align="center" valign="middle">
										<input name="default_location" type="radio" value="0"
										 <? if($data['default_location'] == 0) 
											{?> Checked
											<? }?>>
                                          <span class="simpletxt">No</span></td>
                                      </tr>
                                      <tr>
                                        <td valign="middle" class="simpletxt"><div align="justify"><strong>2. </strong>If customers are allowed to select a location,  allow them to select the headquarters location when searching for open time  slots.</div></td>
                                        <td align="center" valign="middle"><label>
                                          <input name="headquarters_location" type="radio" value="1"
										 <? if($data['headquarters_location'] == 1) 
											{?> Checked
											<? }?>>
                                        </label>
                                          <span class="simpletxt">Yes</span></td>
                                        <td align="center" valign="middle">
										<input name="headquarters_location" type="radio" value="0"
										 <? if($data['headquarters_location'] == 0) 
											{?> Checked
											<? }?>>
                                          <span class="simpletxt">No</span></td>
                                      </tr>
                                      <tr>
                                        <td valign="middle" class="simpletxt"><div align="justify"><strong>3.</strong> Have the location drop down default to the  customer location, but allow them to select other locations.</div></td>
                                        <td align="center" valign="middle"><label>
                                          <input name="location_dropdown" type="radio" value="1"
										 <? if($data['location_dropdown'] == 1) 
											{?> Checked
											<? }?>>
                                        </label>
                                          <span class="simpletxt">Yes</span></td>
                                        <td align="center" valign="middle">
										<input name="location_dropdown" type="radio" value="0"
										 <? if($data['location_dropdown'] == 0) 
											{?> Checked
											<? }?>>
                                          <span class="simpletxt">No</span></td>
                                      </tr>
                                      <tr>
                                        <td valign="middle" class="simpletxt"><div align="justify"><strong>4. </strong>Allow location administrators to access customers  from other locations.</div></td>
                                        <td align="center" valign="middle"><label>
                                          <input name="location_administrators" type="radio" value="1"
										 <? if($data['location_administrators'] == 1) 
											{?> Checked
											<? }?>>
                                        </label>
                                          <span class="simpletxt">Yes</span></td>
                                        <td align="center" valign="middle">
										<input name="location_administrators" type="radio" value="0"
										 <? if($data['location_administrators'] == 0) 
											{?> Checked
											<? }?>>
                                          <span class="simpletxt">No</span></td>
                                      </tr>

                                      <tr>
                                        <td valign="middle" class="simpletxt"><strong>5. </strong>Allow locations to access customers from other  locations.</td>
                                        <td align="center" valign="middle"><label>
                                          <input name="access_customers" type="radio" value="1"
										 <? if($data['access_customers'] == 1) 
											{?> Checked
											<? }?>>
                                        </label>
                                          <span class="simpletxt">Yes</span></td>
                                        <td align="center" valign="middle">
										<input name="access_customers" type="radio" value="0"
										 <? if($data['access_customers'] == 0) 
											{?> Checked
											<? }?>>
                                          <span class="simpletxt">No</span></td>
                                      </tr>
                                      <tr>
                                        <td valign="middle" class="simpletxt"><strong>6.</strong> Allow location users (the lowest level of  access) to access customers from other locations.</td>
                                        <td align="center" valign="middle"><label>
                                          <input name="lowest_level" type="radio" value="1"
										 <? if($data['lowest_level'] == 1) 
											{?> Checked
											<? }?>>
                                        </label>
                                          <span class="simpletxt">Yes</span></td>
                                        <td align="center" valign="middle">
										<input name="lowest_level" type="radio" value="0"
										 <? if($data['lowest_level'] == 0) 
											{?> Checked
											<? }?>>
                                          <span class="simpletxt">No</span></td>
                                      </tr>
                                      <tr>
                                        <td valign="middle" class="simpletxt"><strong>7. </strong>Allow locations to share the same staff members.  Only use this preference if you have more than one location.</td>
                                        <td align="center" valign="middle"><label>
                                          <input name="same_staff" type="radio" value="1"
										 <? if($data['same_staff'] == 1) 
											{?> Checked
											<? }?>>
                                        </label>
                                          <span class="simpletxt">Yes</span></td>
                                        <td align="center" valign="middle">
										<input name="same_staff" type="radio" value="0"
										 <? if($data['same_staff'] == 0) 
											{?> Checked
											<? }?>>
                                          <span class="simpletxt">No</span></td>
                                      </tr>
                                      <tr>
                                        <td colspan="3" align="center">
                                            <input name="Submit" type="submit" class="button" value="Update">
                                         </td>
                                      </tr>
                                    </table>
									</form>
									</td>
                                  </tr>
                                </table>
                              <table border="0" cellspacing="0" cellpadding="0" align="center">
                                  <tr>
                                    <td></td>
                                  </tr>
                              </table></td>
                          </tr>
                        </table>
				  
						<table cellpadding="0" cellspacing="0" border="0">
							<tr>
								<td><img src="images/1_q4.gif" border="0" alt="" width="10" height="10"></td>
								<td style="width:100%; background-image:url(images/1_li1.gif)"></td>
								<td><img src="images/1_q3.gif" border="0" alt="" width="10" height="10"></td>
							</tr>
						</table>
						


		
		
		</td>

    <td class="col_right">

<table border="0"cellspacing="0" cellpadding="0" class="box_width_right">
	<tr><td></td>
		<td width="100%">
			<table border="0" cellspacing="0" cellpadding="0">
				<tr><td></td></tr>
			</table>
		</td>
	</tr>
</table>


    </td>
  </tr>
</table>



		</td>
	</tr>
	<tr>
		<td>
			<table cellpadding="0" cellspacing="0" border="0" style="height:98px; background-image:url(images/bot.gif)">
				<tr>
					<td>
						<table cellpadding="0" cellspacing="0" border="0" class="footer">
							<tr>									
								<td height="77"><img src="images/spacer.gif" border="0" alt="" width="25" height="1"></td>				
								<td style="width:207px"><br style="line-height:49px"><img src="images/p1.gif" border="0" alt="" width="145" height="24"><br></td>
							  <td style="width:532px">&nbsp;</td>
							</tr>
						</table>
					</td>
				</tr>
			</table>
		</td>
	</tr>
</table></td></tr></table>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr>
    <td align="center"></td>
  </tr>
</table>
</body>

</html>